package com.attendance.www.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.attendance.www.hr.dao.mapper.MainOrganizationsVersionMapper;
import com.attendance.www.hr.entitys.MainOrganizationsVersion;
import com.attendance.www.hr.entitys.MainOrganizationsVersionExample;
import com.attendance.www.hr.service.IMainOrganizationsVersionService;
@Service
public class MainOrganizationsVersionServiceImpl implements IMainOrganizationsVersionService {

	@Resource
	private MainOrganizationsVersionMapper mainOrganizationsVersionDao;

	/**
	 * 删除机构版本数据
	 */
	@Override
	public boolean deleteMainOrganizationsVersion() {
		int record=mainOrganizationsVersionDao.deleteByExample(new MainOrganizationsVersionExample());
	    if(record<=0) {
			return false;
		}
		return true;
	}
	
	/**
	 * 新增机构版本数据
	 */
	@Override
	public void saveMainOrganizationsVersion(List<MainOrganizationsVersion> mainOrganizationsVersionList) {
		for (int j = 0; j < mainOrganizationsVersionList.size(); j++) {
		    mainOrganizationsVersionDao.insertSelective(mainOrganizationsVersionList.get(j));
		}
	}
	
	/**
	 * 查询机构版本数据
	 */
	@Override
	public List<MainOrganizationsVersion> getMainOrganizationsVersionList() {
		List<MainOrganizationsVersion> mainOrganizationsVersionList =mainOrganizationsVersionDao.selectByExample(new MainOrganizationsVersionExample());
		return mainOrganizationsVersionList;
	}
}

